Optimal. Leaf size=53 \[ 2 x^2 \tan \left (\frac{x}{2}\right ) \sqrt{a \cos (x)+a}+8 x \sqrt{a \cos (x)+a}-16 \tan \left (\frac{x}{2}\right ) \sqrt{a \cos (x)+a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0959995, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3319, 3296, 2637} \[ 2 x^2 \tan \left (\frac{x}{2}\right ) \sqrt{a \cos (x)+a}+8 x \sqrt{a \cos (x)+a}-16 \tan \left (\frac{x}{2}\right ) \sqrt{a \cos (x)+a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3319
Rule 3296
Rule 2637
Rubi steps
\begin{align*} \int x^2 \sqrt{a+a \cos (x)} \, dx &=\left (\sqrt{a+a \cos (x)} \sec \left (\frac{x}{2}\right )\right ) \int x^2 \cos \left (\frac{x}{2}\right ) \, dx\\ &=2 x^2 \sqrt{a+a \cos (x)} \tan \left (\frac{x}{2}\right )-\left (4 \sqrt{a+a \cos (x)} \sec \left (\frac{x}{2}\right )\right ) \int x \sin \left (\frac{x}{2}\right ) \, dx\\ &=8 x \sqrt{a+a \cos (x)}+2 x^2 \sqrt{a+a \cos (x)} \tan \left (\frac{x}{2}\right )-\left (8 \sqrt{a+a \cos (x)} \sec \left (\frac{x}{2}\right )\right ) \int \cos \left (\frac{x}{2}\right ) \, dx\\ &=8 x \sqrt{a+a \cos (x)}-16 \sqrt{a+a \cos (x)} \tan \left (\frac{x}{2}\right )+2 x^2 \sqrt{a+a \cos (x)} \tan \left (\frac{x}{2}\right )\\ \end{align*}
Mathematica [A] time = 0.0440321, size = 29, normalized size = 0.55 \[ 8 \left (\frac{1}{4} \left (x^2-8\right ) \tan \left (\frac{x}{2}\right )+x\right ) \sqrt{a (\cos (x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.155, size = 70, normalized size = 1.3 \begin{align*}{\frac{-i\sqrt{2} \left ( 4\,ix{{\rm e}^{ix}}+{x}^{2}{{\rm e}^{ix}}+4\,ix-{x}^{2}-8\,{{\rm e}^{ix}}+8 \right ) }{{{\rm e}^{ix}}+1}\sqrt{a \left ({{\rm e}^{ix}}+1 \right ) ^{2}{{\rm e}^{-ix}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.17184, size = 49, normalized size = 0.92 \begin{align*} 2 \,{\left (\sqrt{2} x^{2} \sin \left (\frac{1}{2} \, x\right ) + 4 \, \sqrt{2} x \cos \left (\frac{1}{2} \, x\right ) - 8 \, \sqrt{2} \sin \left (\frac{1}{2} \, x\right )\right )} \sqrt{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: UnboundLocalError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \sqrt{a \left (\cos{\left (x \right )} + 1\right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a \cos \left (x\right ) + a} x^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]